package com.jiazhong.cloud.seata.stock.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiazhong.cloud.seata.stock.bean.Stock;
import com.jiazhong.cloud.seata.stock.mapper.StockMapper;
import com.jiazhong.cloud.seata.stock.service.StockService;
import io.seata.spring.annotation.GlobalTransactional;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements StockService {
    @Resource
    private StockMapper stockMapper;

    @GlobalTransactional
    public int update(Stock stock) {
        return stockMapper.updateStock(stock);
    }
}
